home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsISimpleEnumerator.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  137 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsISimpleEnumerator.idl
  3.  */
  4.  
  5. #ifndef __gen_nsISimpleEnumerator_h__
  6. #define __gen_nsISimpleEnumerator_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsISimpleEnumerator */
  19. #define NS_ISIMPLEENUMERATOR_IID_STR "d1899240-f9d2-11d2-bdd6-000064657374"
  20.  
  21. #define NS_ISIMPLEENUMERATOR_IID \
  22.   {0xd1899240, 0xf9d2, 0x11d2, \
  23.     { 0xbd, 0xd6, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
  24.  
  25. /**
  26.  * Used to enumerate over elements defined by its implementor.
  27.  * Although hasMoreElements() can be called independently of getNext(),
  28.  * getNext() must be pre-ceeded by a call to hasMoreElements(). There is
  29.  * no way to "reset" an enumerator, once you obtain one.
  30.  *
  31.  * @status FROZEN
  32.  * @version 1.0
  33.  */
  34. class NS_NO_VTABLE nsISimpleEnumerator : public nsISupports {
  35.  public: 
  36.  
  37.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISIMPLEENUMERATOR_IID)
  38.  
  39.   /**
  40.    * Called to determine whether or not the enumerator has
  41.    * any elements that can be returned via getNext(). This method
  42.    * is generally used to determine whether or not to initiate or
  43.    * continue iteration over the enumerator, though it can be
  44.    * called without subsequent getNext() calls. Does not affect
  45.    * internal state of enumerator.
  46.    *
  47.    * @see getNext()
  48.    * @return PR_TRUE if there are remaining elements in the enumerator.
  49.    *         PR_FALSE if there are no more elements in the enumerator.
  50.    */
  51.   /* boolean hasMoreElements (); */
  52.   NS_IMETHOD HasMoreElements(PRBool *_retval) = 0;
  53.  
  54.   /**
  55.    * Called to retrieve the next element in the enumerator. The "next"
  56.    * element is the first element upon the first call. Must be
  57.    * pre-ceeded by a call to hasMoreElements() which returns PR_TRUE.
  58.    * This method is generally called within a loop to iterate over
  59.    * the elements in the enumerator.
  60.    *
  61.    * @see hasMoreElements()
  62.    * @return NS_OK if the call succeeded in returning a non-null
  63.    *               value through the out parameter.
  64.    *         NS_ERROR_FAILURE if there are no more elements
  65.    *                          to enumerate.
  66.    * @return the next element in the enumeration.
  67.    */
  68.   /* nsISupports getNext (); */
  69.   NS_IMETHOD GetNext(nsISupports **_retval) = 0;
  70.  
  71. };
  72.  
  73. /* Use this macro when declaring classes that implement this interface. */
  74. #define NS_DECL_NSISIMPLEENUMERATOR \
  75.   NS_IMETHOD HasMoreElements(PRBool *_retval); \
  76.   NS_IMETHOD GetNext(nsISupports **_retval); 
  77.  
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  79. #define NS_FORWARD_NSISIMPLEENUMERATOR(_to) \
  80.   NS_IMETHOD HasMoreElements(PRBool *_retval) { return _to HasMoreElements(_retval); } \
  81.   NS_IMETHOD GetNext(nsISupports **_retval) { return _to GetNext(_retval); } 
  82.  
  83. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  84. #define NS_FORWARD_SAFE_NSISIMPLEENUMERATOR(_to) \
  85.   NS_IMETHOD HasMoreElements(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->HasMoreElements(_retval); } \
  86.   NS_IMETHOD GetNext(nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNext(_retval); } 
  87.  
  88. #if 0
  89. /* Use the code below as a template for the implementation class for this interface. */
  90.  
  91. /* Header file */
  92. class nsSimpleEnumerator : public nsISimpleEnumerator
  93. {
  94. public:
  95.   NS_DECL_ISUPPORTS
  96.   NS_DECL_NSISIMPLEENUMERATOR
  97.  
  98.   nsSimpleEnumerator();
  99.  
  100. private:
  101.   ~nsSimpleEnumerator();
  102.  
  103. protected:
  104.   /* additional members */
  105. };
  106.  
  107. /* Implementation file */
  108. NS_IMPL_ISUPPORTS1(nsSimpleEnumerator, nsISimpleEnumerator)
  109.  
  110. nsSimpleEnumerator::nsSimpleEnumerator()
  111. {
  112.   /* member initializers and constructor code */
  113. }
  114.  
  115. nsSimpleEnumerator::~nsSimpleEnumerator()
  116. {
  117.   /* destructor code */
  118. }
  119.  
  120. /* boolean hasMoreElements (); */
  121. NS_IMETHODIMP nsSimpleEnumerator::HasMoreElements(PRBool *_retval)
  122. {
  123.     return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125.  
  126. /* nsISupports getNext (); */
  127. NS_IMETHODIMP nsSimpleEnumerator::GetNext(nsISupports **_retval)
  128. {
  129.     return NS_ERROR_NOT_IMPLEMENTED;
  130. }
  131.  
  132. /* End of implementation class template. */
  133. #endif
  134.  
  135.  
  136. #endif /* __gen_nsISimpleEnumerator_h__ */
  137.